<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">

<f:view>

	<h:head>
		<title>listCategory</title>
		<meta http-equiv="Content-Type"
			content="application/xhtml+xml; charset=UTF-8" />

		<!--  Subdirectories of resources directory are called libraries -->
		<h:outputStylesheet library="css" name="styles.css" />

	</h:head>
	<h:body>

		<h2>Note Categories</h2>
		<h:form>
			<h:dataTable value="#{categoryController.categoryList}" var="cat"
				rendered="#{categoryController.categoryList.size() > 0}"
				styleClass="category-table">

				<!-->h:column>
			<h:link outcome="showitem" includeViewParams="true"
				value="#{oneItem.name}">
				<f:param name="itemId" value="#{oneItem.id}" />
				<f:param name="cid"
					value="#{javax.enterprise.context.conversation.id}" />
			</h:link>
		</h:column-->

				<h:column>
					<h:outputText value="#{cat.id}" />
				</h:column>

				<h:column>
					<h:outputText value="#{cat.name}" />
				</h:column>
				<h:column>
					<h:outputText value="#{cat.directory}" />
				</h:column>

				<h:column>
					<h:link outcome="editCategory" value="Edit">
						<f:param name="categoryId" value="#{cat.id}" />
					</h:link>
				</h:column>

				<!-- Require ViewScoped/SessionScoped backing to make this work !! -->
				<h:column>
					<h:commandLink action="#{categoryController.deleteCategory}"
						value="Delete">
						<f:param name="categoryId" value="#{cat.id}" />
					</h:commandLink>
				</h:column>

			</h:dataTable>
		</h:form>
		<f:phaseListener type="com.katydid.web.PhaseTracker" />
	</h:body>
</f:view>
</html>